<%--
  Created by IntelliJ IDEA.
  User: 86153
  Date: 2023/3/31
  Time: 15:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>


<html>
<head>
	<base href="<%=basePath%>">
	<link href="css/haiersoft.css" rel="stylesheet" type="text/css" media="screen,print"/>
	<link href="css/print.css" rel="stylesheet" type="text/css" media="print"/>
	<meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8"/>
	<script src="js/jquery-1.10.1.min.js"></script>
	<script src="js/side.js" type="text/javascript"></script>
	<script src="js/jquery-3.6.0.js"></script>
	<script>
        function Update_vocation(e) {
            var formData = new FormData;
            var fileobjs = $("#file")[0].files;
            for (var i = 0; i < fileobjs.length; i++) {
                formData.append("imgs", fileobjs[i]);
            }
            var comAccount = $("#comAccount").val();
            var infoContent = $("#infoContent").val();

            formData.set("comAccount", comAccount);
            formData.set("infoContent", infoContent);

            $.ajax({
                url: 'Enterprise_info/update_vocation',
                contentType: false,
                cache: false,
                processData: false,
                type: 'POST',
                data: formData,
                success: function (data) {
                    if (data.code == '0000') {
                        console.log(data.message);
                        alert("修改失败");
                        window.location.reload();
                    } else if (data.code == '0001') {
                        console.log(data.message);
                        alert("修改成功");
                        window.location.href='Enterprise_info/View_vocation/'+data.data;
                    }
                }
            })
        }
	</script>
	<style>
        .tr1 {
            position: absolute;
            top: 115px;
            left: 30%;
            font-size: 20px;
        }

        .tr2 {
            position: absolute;
            top: 40px;
            left: 30%;
            font-size: 20px;
        }

        .input1 {
            caret-color: #ffa502;
            padding: 20px;
            font-size: 25px;
            outline-style: none;
            border: 1px solid #ccc;
            border-radius: 3px;
        }

        .bt1 {
            Text-align: center;
            position: absolute;
            height: 30px;
            width: 80px;
            top: 600px;
            font-size: 20px;
            color: white;
        }

        .load1 {
            position: absolute;
            top: 470px;
            right: 630px;
            font-size: 20px;
        }
	</style>
</head>
<body>
<%
	String comAccount = request.getParameter("comAccount");
	String infoContent = request.getParameter("infoContent");
%>
<form enctype="multipart/form-data">
	<div class="tr2">
		<th style="font-size:88px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;企业账号:</th>
		<input class="input1" type="text" id="comAccount" value="<%=comAccount%>" readonly>
	</div>
	<div class="tr1">
		<th class="th1">职业信息内容:</th>
		<textarea cols="40" style="width: 666px;height: 300px;" id="infoContent" placeholder="请输入内容"><%=infoContent%></textarea>
	</div>

	<div class="load1">
		<td>上传三张图片：</td>
		<td>
			<input type="file" id="file" multiple="multiple"/>
		</td>
	</div>
	<div class="bt1" style="right:170px; background-color: rgba(0, 155, 134);">
		<span onclick="Update_vocation()" style="cursor:pointer;"><input type="hidden"/>确定</span>
	</div>
	<div class="bt1" style="right:80px; background-color: rgba(102, 102, 102);">
		<a style="color:white;text-decoration:none;" href="Enterprise_info/View_vocation/<%=comAccount%>">返回</a>
	</div>

</form>

</body>
</html>
